/**
 * CodeTestForExp3
 *
 * @author yjx
 * @date 2019.5.2
 */
public class MyUtil {
    public static String percentage2fivegrade(int grade) {
        int a = 0, b = 60, c = 70, d = 80, e = 90, f = 100;
        //如果成绩小于0，转成“错误”
        if ((grade < a)) {
            return "错误";
        }
        //如果成绩小于60，转成“不及格”
        else if (grade < b) {
            return "不及格";
        }
        //如果成绩在60与70之间，转成“及格”
        else if (grade < c) {
            return "及格";
        }
        //如果成绩在70与80之间，转成“中等”
        else if (grade < d) {
            return "中等";
        }
        //如果成绩在80与90之间，转成“良好”
        else if (grade < e) {
            return "良好";
        }
        //如果成绩在90与100之间，转成“优秀”
        else if (grade <= f) {
            return "优秀";
        }
        //如果成绩大于100，转成“错误”
        else {
            return "错误";
        }
    }
}